//消息的请求封装
import request from "@/utils/http.ts"

//1.添加消息
export const addNewAPI = (data: any) => {
    return request({
        url: 'new/addNew',
        method: 'post',
        data: {
            newCreatorId: data.newCreatorId,
            newReceiverId:data.newReceiverId,
            newCreatorName:data.newCreatorName,
            newCreatorAvatar:data.newCreatorAvatar,
            newReceiverName:data.newReceiverName,
            newTitle:data.newTitle,
            newText:data.newText,
        }
    })
}

//2.删除消息
export const deleteNewAPI = (data: any) => {
    return request({
        url: 'new/deleteNew',
        method: 'post',
        params: {
            newId: data.newId,
        }
    })
}

//3.分页获取消息列表
export const pageNewAPI = (data: any) => {
    return request({
        url: 'new/pageNew',
        method: 'post',
        data: {
            pageCurrent: data.pageCurrent,//当前页码
            pageSize: data.pageSize,//每页显示条数
            newReceiverId: data.newReceiverId,//接收者id
        }
    })
}
